FROM golang:1.15

RUN apt-get update
RUN apt-get install -y git mercurial

WORKDIR /app/operator
COPY . .

WORKDIR /app/operator/cmd/manager

RUN CGO_ENABLED=0 go build -mod=vendor
RUN go install -mod=vendor

FROM ubuntu:18.04

COPY --from=0 /go/bin/manager /usr/bin/redis-operator

